Socket
Socket
Sign inDemoInstall

bin-wrapper

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-wrapper

Binary wrapper that makes your programs seamlessly available as local dependencies


Version published
Weekly downloads
689K
decreased by-6.6%
Maintainers
2
Weekly downloads
 
Created

What is bin-wrapper?

The bin-wrapper npm package is a utility that helps you download and manage binaries for your Node.js projects. It allows you to specify a binary, download it if necessary, and make it available for use in your project. This is particularly useful for ensuring that the correct version of a binary is used, regardless of the environment in which your code is running.

What are bin-wrapper's main functionalities?

Download and manage binaries

This feature allows you to specify different sources for binaries based on the operating system and architecture. The code sample demonstrates how to set up a BinWrapper instance to download the gifsicle binary for different platforms and run it to check its version.

const BinWrapper = require('bin-wrapper');
const path = require('path');

const base = 'https://raw.githubusercontent.com/imagemin/gifsicle-bin/main/vendor';
const bin = new BinWrapper()
  .src(`${base}/macos/gifsicle`, 'darwin')
  .src(`${base}/linux/x64/gifsicle`, 'linux', 'x64')
  .src(`${base}/win/x64/gifsicle.exe`, 'win32', 'x64')
  .dest(path.join(__dirname, 'vendor'))
  .use(process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle');

bin.run(['--version']).then(() => {
  console.log('Binary is working');
}).catch(err => {
  console.error('Binary failed to run', err);
});

Other packages similar to bin-wrapper

Keywords

FAQs

Package last updated on 16 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc